using System;
using System.Linq;
using System.Diagnostics;
using WLFramework.Data;

namespace MonoTest
{
	class MainClass
	{
		public class test
		{
			public int id{ get; set; }
			public string name{ get; set; }
			public string remark{ get; set; }

			public override string ToString ()
			{
				return string.Format ("[test: id={0}, name={1}, remark={2}]", id, name, remark);
			}
		}

		public static void Main (string[] args)
		{
			Stopwatch watch = new Stopwatch();
			watch.Start();
			DbManager.DefaultConfiguration = "Default";
			DbManager.AddDataProvider (new WLFramework.Data.DataProvider.PostgreSQLDataProvider ());
			using (DbManager db = new DbManager()) {
				var query = db.GetTable<test> ().Skip (1000).Take (100);
				foreach (var item in query) {
					//Console.WriteLine(item.ToString());
				}
			}

			Console.WriteLine("takes " + watch.ElapsedMilliseconds + "ms");
		}
	}
}
